package com.tcm.common.enums;

import lombok.Getter;

/**
 * 响应状态枚举
 * @author guqier
 * @version 1.0
 */
@Getter
public enum ResponseEnum {

    /*
    通用状态码
     */
    SUCCESS(1,"success"),
    ERROR(0,"error"),

    /*
    业务错误状态码
     */
    PARAM_IS_INVAlID(101,"参数无效"),

    PARAM_IS_BLANK(102,"必要参数为空"),

    NOTE_NOT_EXIST(103,"笔记不存在"),



    /* 用户错误  201 - 299  */
    USER_NOT_LOGIN(201,"用户未登录"),
    INVALID_TOKEN(202, "无效Token信息"),
    USER_NOT_EXIST(203,"用户不存在"),
    USER_LOGIN_ERROR(204,"登陆失败，账号或者密码有误"),
    NOT_PERMISSION(205,"无权限访问"),
    TOKEN_EXPIRED(206,"Token已过期"),
    NOT_FOR_STUDENT(207,"管理后台仅限教师或管理员登录"),
    ERROR_AUTH_CODE(208,"验证码错误"),
    WX_ERROR(209,"微信验证错误"),
    CODE_EMPTY(210,"CODE不存在"),
    WX_USER_NEED_BIND(211,"未绑定账号"),
    WX_USER_BIND_ERROR(212,"绑定账号失败"),


    /* 业务错误 301 - 399*/
    DATA_NOT_FOUND(301,"没有数据"),
    HANDLE_FAIL(302,"业务处理失败"),

    DATABASE_OPERATION_FAIL(303,"数据库操作失败"),
    UPLOAD_FAIL(304,"文件上传失败"),
    DAILY_ALREADY_FINISHED(305,"每日一练已完成"),
    GROUP_JOIN_COUNT_MAX(306,"加入小组数已最大"),
    GROUP_INVITATION_CODE_INVALID(307,"邀请码不存在或已过期"),
    TEST_PAPER_INVALID(308,"试卷不存在或已删除"),
    SYSTEM_ERROR(999,"系统异常"),

    /* 数据错误 */
    CACHE_NOT_EXIST(401, "缓存不存在或已过期");

    //返回状态码
    private Integer code;

    //返回消息
    private String msg;


    ResponseEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
